package com.zhj.business.controller;

import com.zhj.common.core.result.Result;
import com.zhj.common.core.util.ResultUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhj
 */
@RestController
@RequestMapping("/demo")
public class DemoController {

    @Value("${com.name}")
    private String profilesActive;

    private Logger logger = LoggerFactory.getLogger(DemoController.class);

    @GetMapping("/test")
    public Result<String> test(){
        logger.info("测试接口正常调用!");

        return ResultUtils.createSuccess("Hello , Welcome to Base-Platform Demo Test. \n The Spring profiles active = " + profilesActive);
    }
}
